package abel.wlmr.model.type;

import java.util.HashMap;
import java.util.Map;

public enum WlmrErrorType {
    Correct((short) 0),
    Error((short) 1),
    Reserved((short) 2);

    private short value;

    private static Map<Short, WlmrErrorType> enumList = new HashMap<>();
    static {
        for (WlmrErrorType b : WlmrErrorType.values()) {
            enumList.put(b.value, b);
        }
    }

    private WlmrErrorType(short v) {
        this.value = v;
    }

    public static WlmrErrorType findEnumByValue(short v) {
        if (v < 0 || v > 255)
            return null;
        return enumList.get(v);
    }

    /**
     * @return the value
     */
    public short getValue() {
        return value;
    }
}
